package com.eyas.im.protocol.decoder;

import com.eyas.im.protocol.protocol.Protocol;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * 协议解码器，需要解决TCP半包、粘包问题
 * @param <T>
 */
public interface Decoder<T extends Protocol> {
    public final static byte PROTOCOL_HEADER_START = 0;
    public final static byte[] PROTOCOL_BREAKER = {10,3};
    T decode(byte[] bytes) throws IOException;
}
